
#ifndef _TY_RESULTSET_H_
#define _TY_RESULTSET_H_


namespace tylenol { namespace database {


#define MAX_RESULTSET				1048576 //1Mbyte
#define MAX_RESULTSET_FIELDSIZE		128


class CResultSet
{
public:
	CResultSet();
	virtual ~CResultSet();

	bool	Init(short row, short field);
	bool	Init(const char *buff, int len);
	bool	Add(const char *item);
	bool	MoreRecord();

private:
	bool	AddShort(short *value);
	bool	AddString(const char *item);
	bool	Allocate();

public:
	char	m_Data[MAX_RESULTSET];
	char	**ROW;
	int		m_Offset;
	short	m_Fields;
	short	m_Rows;
	char	*m_pVal;

private:
	char	*m_pBuff;
	short	m_CurrentField;
	short	m_CurrentRow;
	bool	m_bIsFirstMoreRecord;
};

} /*database*/ } /*tylenol*/

#endif // _TY_RESULTSET_H_


